const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
//   transpileDependencies: true
// })
module.exports = {
  // 关闭语法检查
  lintOnSave: false,
  // 解决axios发送请求时的跨域问题,不做配置会报错如下↓↓↓↓
  // ccess to XMLHttpRequest at 'http://127.0.0.1:23456/webPage/home_notice.post' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  devServer: {
    open: true,
    host: 'localhost',
    port: 8080,
    // https: false,
    proxy: {
      //  /api 表示拦截以/api开头的请求路径
      "/webPage": {
        target: "http://localhost:9000/", // 跨域的域名（不需要重写路径）
        ws: false, // 是否开启websockede
        changeOrigin: true, // 是否开启跨域
        pathRewrite: {
          "^/webPage": "",
        },
      },
    },
  },
};
